<?php
$sql['get_status_ta']="
  SELECT  
  	tastatId AS data,
  	tastatNama AS label
  FROM
  	i_tugas_akhir_status;
";

$sql['get_topik_ta']="
  SELECT 
  	tatpkId AS data,
  	tatpkNama AS label
  FROM i_tugas_akhir_topik;
";

$sql['get_data_combo_tugas_akhir']="
   SELECT 
   	taId AS data,
	   LEFT(taJudul,22) AS label
   FROM
   	u_tugas_akhir
   WHERE 
   taMhsId='%s'";
   
$sql['get_data_tugas_akhir_by_mhs_id']="
  SELECT 
  	taId AS TA_ID,
  	taMhsId AS TA_MHS_ID,
  	tatpkNama AS TA_TOPIK,
  	taTopikLainnya AS TA_TOPIK_LAINNYA,
  	taJudul AS TA_JUDUL,
  	taSemesterDaftar AS TA_SEMESTER_DAFTAR,
  	tastatNama AS TA_STATUS
  FROM
  	u_tugas_akhir
  LEFT JOIN i_tugas_akhir_topik ON tatpkId=taTopikId
  LEFT JOIN i_tugas_akhir_status ON tastatId=taStatusId
  WHERE taMhsId='%s';
";
$sql['get_data_tugas_akhir_by_id']="
  SELECT 
   	taJudul AS TA_JUDUL,
   	IF(tatpkNama='Lainnya',taTopikLainnya,tatpkNama) AS TA_TOPIK,
   	upper(taSemesterDaftar) AS TA_SEMESTER,
   	upper(tastatNama) AS TA_STATUS
   FROM
   	u_tugas_akhir
   	LEFT JOIN i_tugas_akhir_topik ON tatpkId=taTopikId
   	LEFT JOIN i_tugas_akhir_status ON tastatId=taStatusId
   WHERE 
   taId ='%s'";
  
$sql['do_add_tugas_akhir']="
  INSERT u_tugas_akhir 
  SET
  	taMhsId='%s',
  	taTopikId='%s',
  	taTopikLainnya='%s',
  	taJudul='%s',
  	taSemesterDaftar='%s',
  	taStatusId='%s'
";

$sql['do_update_ta']="
  UPDATE u_tugas_akhir 
  SET
  	taMhsId='%s',
  	taTopikId='%s',
  	taTopikLainnya='%s',
  	taJudul='%s',
  	taSemesterDaftar='%s',
  	taStatusId='%s'
  WHERE 
  	taId='%s'
";
?>
